From: Florian Müllner Date: Wed, 24 Feb 2021 01:28:09 +0000 (+0100) Subject: lightbox: Fix shader effect X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~616^2^2~246 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=ef777426d2bbc9584fa1d2805280109553105b11;p=gnome-shell.git lightbox: Fix shader effect Since commit 0f1b566918e, we use gjs' automatic getters/setters for the shader properties. Those handle the properties on the JS and GObject side, but they don't update the corresponding uniform, whoops. Revert the lightbox bits of commit 0f1b566918 to get the effect back. Part-of: --- diff --git a/js/ui/lightbox.js b/js/ui/lightbox.js index d8de7e730..8348abada 100644 --- a/js/ui/lightbox.js +++ b/js/ui/lightbox.js @@ -35,13 +35,16 @@ var RadialShaderEffect = GObject.registerClass({ }, }, class RadialShaderEffect extends Shell.GLSLEffect { _init(params) { + this._brightness = undefined; + this._sharpness = undefined; + super._init(params); this._brightnessLocation = this.get_uniform_location('brightness'); this._sharpnessLocation = this.get_uniform_location('vignette_sharpness'); - this._setBrightnessUniform(); - this._setSharpnessUniform(); + this.brightness = 1.0; + this.sharpness = 0.0; } vfunc_build_pipeline() { @@ -49,14 +52,30 @@ var RadialShaderEffect = GObject.registerClass({ VIGNETTE_DECLARATIONS, VIGNETTE_CODE, true); } - _setBrightnessUniform() { + get brightness() { + return this._brightness; + } + + set brightness(v) { + if (this._brightness === v) + return; + this._brightness = v; this.set_uniform_float(this._brightnessLocation, - 1, [this.brightness]); + 1, [this._brightness]); + this.notify('brightness'); } - _setSharpnessUniform() { + get sharpness() { + return this._sharpness; + } + + set sharpness(v) { + if (this._sharpness === v) + return; + this._sharpness = v; this.set_uniform_float(this._sharpnessLocation, - 1, [this.sharpness]); + 1, [this._sharpness]); + this.notify('sharpness'); } });